#ifndef CPerspectiveViewVolume_____
#define CPerspectiveViewVolume_____

#include "Matrix44f.h"
#include "Plane.h"

class CPerspectiveViewVolume
{
	// Notes: designed for projecting a 3D image onto a 2D screen

  public:

	//-------------------------------------------------------------------------
	// members
	//-------------------------------------------------------------------------

	float m_fAspect, m_fNearZ, m_fFarZ, m_fAngleFOV;
	CPlane m_plnFrustum[6]; // near, far, left, right, top, bottom
	int m_nWndOriginX, m_nWndOriginY, m_nWndWidth, m_nWndHeight;

	//-------------------------------------------------------------------------
	// constructors
	//-------------------------------------------------------------------------

	CPerspectiveViewVolume();
	
	//-------------------------------------------------------------------------
	// functions
	//-------------------------------------------------------------------------

	void OnWindowResize();
	void ExtractFrustumPlanes();
	bool SphereInFrustum(vector3f p, float radius);

};

#endif